package cn.bestick.thirteenKiller.dao;

import cn.bestick.thirteenKiller.util.DbUtil;
import java.sql.Connection;

/**
 * Created by bestick on 2016/1/17.
 */
public class BaseDao {
    private DbUtil dbUtil = null;
    private Connection con = null;

    protected BaseDao() {
        dbUtil = new DbUtil();
    }

    protected Connection getCon() {
        try {
            con = this.dbUtil.getCon();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return con;
    }

    protected void close(Connection con) {
        try {
            this.dbUtil.closeCon(con);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
